package cn.cqie.attendance.common.config;

import org.apache.shiro.authc.UsernamePasswordToken;

import java.io.Serializable;

public class UserToken extends UsernamePasswordToken implements Serializable {

    private static final long serialVersionUID = 1L;

    private String username;

    private String password;

    private String token;

    private String role;

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public UserToken(String token) {
        this.token = token;
    }

    public UserToken(String username, String password, String role) {
        this.username = username;
        this.password = password;
        this.role = role;
    }

    @Override
    public Object getPrincipal() {
        return token;
    }

    @Override
    public Object getCredentials() {
        return token;
    }
}
